package core.objects;

import java.util.Objects;


public abstract class BaseObject extends ObjectWithID {

    
    private String _name;

    public BaseObject(int id, String name) {
        super(id);
        this._name = name;
    }

    public String getName() {
        return this._name;
    }

    @Override
    public boolean equals(Object o) {
        if (!(o instanceof BaseObject)) {
            return false;
        }
        return ((BaseObject) o).getName().equals(_name);
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 79 * hash + Objects.hashCode(this._name);
        return hash;
    }

    public void setName(String _name) {
        this._name = _name;
    }
    
    @Override
    public String toString() {
        return getName();
    }
}
